package com.mingqijia.gassafety.webserver.response;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.TableField;
import com.mingqijia.gassafety.db.entity.Contacts;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;

import java.util.List;

/**
 * @author zhangfei
 * @version 1.0.0
 * @ClassName WarningDataResponse.java
 * @Description TODO
 * @createTime 2023年02月09日
 */
@Data
@NoArgsConstructor
@Slf4j
public class WarningDataResponse {

    @ApiModelProperty(value = "主键")
    private Long id;
    @ApiModelProperty(value = "设备号")
    private String iMEI;

    @ApiModelProperty(value = "报警开始时间：格式-2022-01-21 11:26:56")
    private String warningStartTime;

    @ApiModelProperty(value = "浓度值")
    private Integer concentration;

    @ApiModelProperty(value = "外呼处理状态：0未处理 1已处理 2已手动外呼")
    private String disposeStatus;

    @ApiModelProperty(value = "处理时间")
    private String disposeTime;

    @ApiModelProperty(value = "处理原因")
    private String reason;

    @ApiModelProperty(value = "报警持续时长:例子-00:00:30")
    private String warningDuration;

    @ApiModelProperty(value = "设备类型")
    private String equipmentType;

    @ApiModelProperty(value = "安装位置")
    private String installationPosition;

    @ApiModelProperty(value = "报警策略id")
    private Long strategyId;


    @ApiModelProperty(value = "设备厂商")
    private String equipmentManufacturer;
    @ApiModelProperty(value = "设备型号")
    private String equipmentModel;
    @ApiModelProperty(value = "户名")
    private String custName;
    @ApiModelProperty(value = "户址")
    private String custAddress;
    @ApiModelProperty(value = "户主手机号")
    private String custPhone;
    @ApiModelProperty(value = "行业类型")
    private String industryType;


    @ApiModelProperty(value = "户号")
    private String subsCode;
    @ApiModelProperty(value = "用户id")
    private String memberId;
    @ApiModelProperty(value = "联系人姓名")
    private String Name;
    @ApiModelProperty(value = "联系人手机号")
    private String Phone;
    @ApiModelProperty(value = "地址")
    private String Address;
    @ApiModelProperty(value = "客户id")
    private Integer consumerId;
    @ApiModelProperty(value = "设备id")
    private String equipmentId;


    @ApiModelProperty(value = "设备来源：0：默认 1：紫荆wifi设备")
    private String equipmentFrom;

    @ApiModelProperty(value = "紫荆设备编号")
    private String deviceNo;

    @ApiModelProperty(value = "联机码")
    private String onlineCode;

    @ApiModelProperty(value = "安装经度")
    private String positionLon;

    @ApiModelProperty(value = "安装纬度")
    private String positionLat;
    @ApiModelProperty(value = "接收器编号")
    private String receiverCode;

    @ApiModelProperty(value = "接收器类型 市电款 电池款")
    private String receiverType;

    @ApiModelProperty(value = "供电方式")
    private String receiverPowerMode;


    @ApiModelProperty(value = "检测类型")
    private String detectionType;

    @ApiModelProperty(value = "通讯方式")
    private String communicationMode;

    @ApiModelProperty(value = "设备名称")
    private String equipmentName;

    /**
     * 发起操作人姓名（账号）
     */
    @ApiModelProperty("发起操作人姓名（账号）")
    private String operatorBy = "";

    @ApiModelProperty(value = "客户名称")
    private String name;
    @ApiModelProperty(value = "客户类型, 默认0:普通客户,1紫荆客户")
    private String custType;

    @ApiModelProperty(value = "设备状态")
    private String equipmentStatus;
    @ApiModelProperty(value = "电磁阀信息")
    private String hasValve;
    @ApiModelProperty(value = "最近一次上报时间")
    private String latestTime;
    @ApiModelProperty(value = "经纬度")
    private String lonLat;

    @ApiModelProperty(value = "燃气公司")
    private String companyName;

    @ApiModelProperty(value = "联系人（级别1）姓名")
    private String contactName1;
    @ApiModelProperty(value = "联系人（级别1）联系方式")
    private String contactPhone1;

    @ApiModelProperty(value = "联系人（级别2）姓名")
    private String contactName2;
    @ApiModelProperty(value = "联系人（级别2）联系方式")
    private String contactPhone2;

    @ApiModelProperty(value = "联系人（级别3）姓名")
    private String contactName3;
    @ApiModelProperty(value = "联系人（级别3）联系方式")
    private String contactPhone3;

    @ApiModelProperty(value = "联系人（级别4）姓名")
    private String contactName4;
    @ApiModelProperty(value = "联系人（级别4）联系方式")
    private String contactPhone4;

    @ApiModelProperty(value = "联系人（级别5）姓名")
    private String contactName5;
    @ApiModelProperty(value = "联系人（级别5）联系方式")
    private String contactPhone5;

    @ApiModelProperty(value = "联系人（级别6）姓名")
    private String contactName6;
    @ApiModelProperty(value = "联系人（级别6）联系方式")
    private String contactPhone6;

    @ApiModelProperty(value = "联系人（级别7）姓名")
    private String contactName7;
    @ApiModelProperty(value = "联系人（级别7）联系方式")
    private String contactPhone7;
    @ApiModelProperty(value = "联系人（级别8）姓名")
    private String contactName8;
    @ApiModelProperty(value = "联系人（级别8）联系方式")
    private String contactPhone8;
    @ApiModelProperty(value = "联系人（级别9）姓名")
    private String contactName9;
    @ApiModelProperty(value = "联系人（级别9）联系方式")
    private String contactPhone9;
    @ApiModelProperty(value = "联系人（级别10）姓名")
    private String contactName10;
    @ApiModelProperty(value = "联系人（级别10）联系方式")
    private String contactPhone10;


    public void setContact(Object c) {
        if (StringUtils.isEmpty(c)) return;
        String[] contacts=(String[])c;
        log.info("setContact-contacts:{}",JSONObject.toJSONString(contacts));
        if (contacts.length <= 0) return;
            this.contactName1 = contacts[0];
            this.contactPhone1 = contacts[1];
            this.contactName2 = contacts[2];
            this.contactPhone2 = contacts[3];
            this.contactName3 = contacts[4];
            this.contactPhone3 = contacts[5];
            this.contactName4 = contacts[6];
            this.contactPhone4 = contacts[7];
            this.contactName5 = contacts[8];
            this.contactPhone5 = contacts[9];
            this.contactName6 = contacts[10];
            this.contactPhone6 = contacts[11];
            this.contactName7 = contacts[12];
            this.contactPhone7 = contacts[13];
            this.contactName8 = contacts[14];
            this.contactPhone8 = contacts[15];
            this.contactName9 = contacts[16];
            this.contactPhone9 = contacts[17];
            this.contactName10 = contacts[18];
            this.contactPhone10 = contacts[19];
        log.info("setContact-this:{}",JSONObject.toJSONString(this));
    }

    @ApiModelProperty(value = "电磁阀名称")
    private String valveName;
    @ApiModelProperty(value = "电磁阀型号")
    private String valveModel;
    @ApiModelProperty(value = "电磁阀材质")
    private String valveMaterial;
    @ApiModelProperty(value = "电磁阀厂家")
    private String valveManufacturer;


    @ApiModelProperty(value = "电磁阀id")
    private Integer valveInfoId;

    @ApiModelProperty(value = "客户地址")
    private String customerAddress;
}